﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace GameEngine
{
    public class DragAbleObject : GameObject
    {
        public Vector2 ValidPosition { set; get; } 

        public DragAbleObject(Texture2D sprite, Vector2 location)
        {
            SpriteSheet = sprite;
            WorldLocation = location;
            ValidPosition = location;
            drawDepth = 0.825f;

        }

        public void moveObject() {
            if (Mouse.GetState().LeftButton == ButtonState.Pressed) 
            {
                Functions.ODS("intersects");
                WorldLocation = MousePointer.Position;

            }
        }

        private bool MouseOverObject() 
        {
            return CollisionRectangle.Intersects(MousePointer.CollisionBox);
        }

        private void SnappPos() { }
        public override void Update(GameTime gameTime)
        {
            moveObject();

        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(SpriteSheet, WorldLocation,Color.White);


        }
    }
}
